# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-rfc5424-logging-handler
pkgname=('python2-rfc5424-logging-handler' 'python-rfc5424-logging-handler')
_pkgname=rfc5424-logging-handler
pkgver=1.4.3
pkgrel=7
pkgdesc='An up-to-date, RFC5424-Compliant syslog handler for the Python logging framework.'
arch=('any')
url='https://pypi.org/project/rfc5424-logging-handler/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('127d29392e41697655978ab9344bb115e97ec71e57d76cad584fdc2a7471f1519ae6073c4fc38f10276249f4daf62730c9124f93ec700a8c31d9202099ff092c')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-rfc5424-logging-handler() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-rfc5424-logging-handler() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

